#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main()
{
    int n;
    cin >> n;
    double e = 1.0;
    double acurate = 1.0/pow(10, n+1);
    int i =1;
    while(true)
    {
        long fac = 1;
        for(int j =1; j<=i; j++)
            fac = fac * j;
        double cur = 1.0 / fac;
        if(cur < acurate)
            break;
        else
            e = e + cur;
         i++;   
    }
    cout << fixed << setprecision(n+1) << e;
}